package com.example.springconfig.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldControl {
    @RequestMapping("/hello")
   public String hello(){
        return "hello world RestController";
    }

    //这里测试业务逻辑需要获取配置文件中的某个值 使用 @Value 读取配置文件值
    @Value("${person.lastName}")
    private String name;
    @RequestMapping("/sayhello")
    public String sayHello(){
        return "hello "+name;
    }
}
